﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using System.ComponentModel;

namespace Jemgine.Gui
{
    public struct Rectangle
	{
        public float X;
        public float Y;
        public float Width;
        public float Height;

        public Vector2 Min { get { return new Vector2(X, Y); } }
        public Vector2 Max { get { return new Vector2(X + Width, Y + Height); } }

        public float Right { get { return X + Width; } }
        public float Left { get { return X; } }
        public float Top { get { return Y; } }
        public float Bottom { get { return Y + Height; } }

		public Rectangle(float _X, float _Y, float _Width, float _Height)
		{
			X = _X;
			Y = _Y;
			Width = _Width;
			Height = _Height;
		}

		public Rectangle(Rectangle Other)
		{
			this.X = Other.X;
			this.Y = Other.Y;
			this.Width = Other.Width;
			this.Height = Other.Height;
		}

		public bool Inside(float _X, float _Y)
		{
			if (_X < X) return false;
			if (_X >= X + Width) return false;
			if (_Y < Y) return false;
			if (_Y >= Y + Height) return false;
			return true;
		}
	}
}